package com.dragon.mmochat.message;

import com.dragon.mmochat.MmochatConstant;
import com.skymobi.buffer.SkymobiBuffer;
import com.skymobi.message.SkymobiProtocolMessage;

public class Mmochat_11_2S extends SkymobiProtocolMessage {
	int type;
	byte line;
	int roleId;
	String rollMsg = null;
	String msg;
	int equipId = -1;
	int mapId = -1;
	short x = 0;
	short y = 0;

	public Mmochat_11_2S() {
		setMsgCode(MmochatConstant.MSGCODE_MMOCHAT_S_11_2);
	}

	@Override
	protected void encodeBody(SkymobiBuffer out) {
		out.putInt(type);
		out.put(line);
		out.putInt(roleId);
		if (rollMsg == null) {
			out.putShort((short) 0);
		} else {
			out.putPrefixedString(rollMsg, 2);
		}
		if (msg == null) {
			out.putShort((short) 0);
		} else {
			out.putPrefixedString(msg, 2);
		}
		out.putInt(equipId);
		out.putInt(mapId);
		out.putShort(x);
		out.putShort(y);
	}

	public void setType(int type) {
		this.type = type;
	}

	public void setLine(byte line) {
		this.line = line;
	}

	public void setRoleId(int roleId) {
		this.roleId = roleId;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public void setEquipId(int equipId) {
		this.equipId = equipId;
	}

	public void setRollMsg(String rollMsg) {
		this.rollMsg = rollMsg;
	}

	public void setMapId(int mapId) {
		this.mapId = mapId;
	}

	public void setX(short x) {
		this.x = x;
	}

	public void setY(short y) {
		this.y = y;
	}

}